﻿using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;

namespace Micro.Extensions.Bridge.QuickStart.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class SpiderCallTestController : ControllerBase
    {
        private readonly IBridge _bridge;

        public SpiderCallTestController(IBridge bridge)
        {
            _bridge = bridge;
        }

        [HttpGet("calltest")]
        public async Task<IEnumerable<WeatherForecast>> CallTestAsync()
        {
            //调用服务
           return await _bridge.GetAsync<IEnumerable<WeatherForecast>>("micro.srv.daldemo", "/WeatherForecast");
        }
    }
}
